;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2021 jgart <jgart@dismail.de>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

;;; Commentary:

;; Cyberia is a kind and amazing hacker collective centered in Minnesota,
;; with global friends.

;; https://cyberia.club/

(define-module (guixrus packages cyberia)
  #:use-module (guix packages)
  #:use-module (guix utils)
  #:use-module (guix git-download)
  #:use-module (guix build-system go)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system ruby)
  #:use-module (gnu packages ruby)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module ((guixrus licenses) #:prefix license:))

(define-public terminal-shit
  (let ((commit "36cfd6e756a7ce73e84810ca37b9ffd43a69fd78")
        (revision 0))
    (package
      (name "terminal-shit")
      (version commit)
      (source (origin
                (method git-fetch)
                (uri (git-reference
                      (url "https://giit.cyberia.club/~vvesley/terminal_shit")
                      (commit commit)))
                (sha256
                 (base32
                  "0b8v4fnwdk0djd58cdz4bvvam64mlrs84yda8lcmv68dbsjlzh1a"))
                (file-name (git-file-name name version))))
      (build-system go-build-system)
      (arguments
        '(#:tests? #f
          #:import-path "giit.cyberia.club/~vvesley/terminal_shit"))
      (home-page "https://giit.cyberia.club/~vvesley/terminal_shit")
      (synopsis "shitchat client in the terminal")
      (description
"@code{terminal-shit} is a chat client that can be run in two modes: in and out.")
      (license license:gpl3))))

(define-public shitchat
  (let ((commit "3994c88358f03e744449ca1af92bd2591d6286d2")
        (revision 0))
    (package
      (name "shitchat")
      (version commit)
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://git.j3s.sh/git/shitchat")
                (commit commit)))
          (sha256
           (base32
            "08k1sn20b1j4gk8nwy1cc49vrzwvfhczy9fanyyk0xp1hvkirlvy"))
          (file-name (git-file-name name version))))
      (build-system ruby-build-system)
      (propagated-inputs
        (list ruby-sinatra ruby-thin))
      (arguments
        `(#:modules ((guix build ruby-build-system)
                     (guix build utils)
                     (ice-9 textual-ports))
          #:tests? #f ; There are no shitty tests.
          #:phases
          (modify-phases %standard-phases
            (add-after 'unpack 'create-shitchat.gemspec
              (lambda* (#:key outputs #:allow-other-keys)
                (with-output-to-file "shitchat.gemspec"
                  (lambda _
                    (format #t
                            "~@
                            Gem::Specification.new do |s|~@
                              s.name        = 'shitchat'~@
                              s.version     = '0.1.0'~@
                              s.summary     = \"chat, but.... shittily\"~@
                              s.authors     = [\"j3s\"]~@
                              s.files       = [\"app.rb\"]~@
                            end~@
                             ")))))
            (add-after 'extract-gemspec 'remove-Gemfile.lock
              (lambda _
                (delete-file "Gemfile.lock"))))))
      (home-page "https://git.j3s.sh/shitchat")
      (synopsis "Chat, but.... shittily")
      (description "@code{shitchat} is a shitty chat app.")
      (license license:none))))
